# long 爬虫
# {2021/9/7}
# 本章目的：re正则

# (?P<分组名字>正则)
import re
obj = re.compile(r"\d+")

s = """<div class='jac'><span id='1'>老特</span></div>
        <div class='jxc'><span id='2'>我的</span></div>
        <div class='ggg'><span id='3'>名字</span></div>
        <div class='qq'><span id='4'>伊娃</span></div>
        <div class='w'><span id='5'>空间</span></div>"""
obj = re.compile(r"<div class='(?P<calss>.*?)'><span id='(?P<id>\d+)'>(?P<name>.*?)</span></div>",re.S)

result = obj.finditer(s)

for i in result:
    print(i.group("name"))